Skip to main content Skip to complementary content

Prerequisites

Before using Google Cloud SQL for MySQL as an endpoint in a Replicate task, make sure the prerequisites outlined below have been met.

Driver prerequisites

Replicate on Windows

Install MySQL ODBC Unicode Driver 64-bit version 8.0.32 on the Replicate machine.

Replicate on Linux

  1. Stop the Replicate service:

    ./areplicate stop
  2. Optionally, confirm that the service has stopped:

    ./areplicate status
  3. Install MySQL ODBC Unicode Driver 64-bit version 8.0.32 on the Replicate machine.
  4. Change the working directory to <Replicate-Install-Dir>/bin.

  5. Copy the driver location to the site_arep_login.sh file:

    echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/usr/lib64" >> site_arep_login.sh

    This will add the driver to "LD_LIBRARY_PATH" and update the driver location in the site_arep_login.sh file.

  6. Optionally, confirm that the driver location was copied:

    cat site_arep_login.sh
  7. Make sure that the /etc/odbcinst.ini file contains an entry for MySQL, as in the following example:

    [MySQL ODBC 8.0 Unicode Driver]

    Driver = /usr/lib64/libmyodbc8w.so

    UsageCount = 1

  8. Start the Replicate service:

    ./areplicate start
  9. Optionally confirm that the service has started:

    ./areplicate status

Google Cloud SQL for MySQL replication

Replication enables data from one Google Cloud SQL for MySQL database server (the primary server) to be copied to one or more Google Cloud SQL for MySQL database servers (the secondary servers).

The Replicate Google Cloud SQL for MySQL source endpoint can be configured to replicate data from either a the primary server or a secondary server.

To replicate changes from a secondary server (CDC), the binary logging parameter log_slave_updates needs to be set to true (1).

Verifying that Google Cloud SQL for MySQL is set up for CDC (Change Data Capture)

Google Cloud SQL for MySQL enables binary logging (i.e. CDC) by default. To check that binary logging is indeed enabled, make sure that the Google Cloud SQL for MySQL database binlog_row_image parameter is set to full.

Replicating 4-byte UTF8 emojis

Replication of 4-byte UTF8 emojis to certain targets requires the following preparation:

  • Microsoft SQL Server Target: Transform the emojis from WSTRING(n) to WSTRING(n*2).
  • Amazon Redshift Target: Transform the emojis from WSTRING(n) to WSTRING(n*2).

For information on defining transformations, see Using the Transform tab.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!